<?php
ini_set('session.use_trans_sid', '1');
ini_set('session.use_cookies', '0');
ini_set('session.use_only_cookies', '0');

session_start();
if (isset($_SESSION['nVisitas'])) {
	$_SESSION['nVisitas']=$_SESSION['nVisitas']+1;
}
else {
	$_SESSION['nVisitas']=1;
}

echo "<h1>Visitas: {$_SESSION['nVisitas']}</h1>";
echo <<<FORM
<form action="contador.php" method="post">
<input type="submit">
</form>
FORM;
?>
<?php
ini_set ( "session.use_cookies", 0 );
ini_set ( "session.use_only_cookies", 0 );
ini_set ( "session.use_trans_sid", 1 );
session_start ();
if (isset ( $_SESSION ['nVisitas'] )) {
	$_SESSION ['nVisitas'] = $_SESSION ['nVisitas'] + 1;
} else {
	$_SESSION ['nVisitas'] = 1;
}

echo "<h1>Visitas: {$_SESSION['nVisitas']}</h1>";
?>
<form>
<input type="submit">
<input type="hidden" name="campo" value="oculto">
</form>
